package com.coollang.smartbra.constant;

import android.os.Environment;

import com.coollang.smartbra.R;
import com.coollang.smartbra.interfaces.ActionType;
import com.coollang.smartbra.utils.UIUtils;
import com.coollang.smartbra.utils.Urls;

import java.io.File;

/**
 * 配置列表
 */

public class Constants {

    /**
     * 网络数据接口
     */
    public static String HOST = Urls.SERVER;
    public static String USER = HOST + "user/";

    /**
     * sd卡根目录
     */
    public static String SDDRECTORY = Environment.getExternalStorageDirectory().getPath() + File.separator;
    public static String SDCARDPATH = SDDRECTORY + "smartbra/";
    public static String MY_SHARE_PATH = SDCARDPATH + "ShareImg.jpg";

    //统计所用常量
    public static String TYPE_SETDATE = "date";
    public static String TYPE_SETHEIGHT = "height";
    public static String TYPE_SETWEIGHT = "weight";
    public static int TYPE_DAY = 0;
    public static int TYPE_WEEK = 1;
    public static String WELCOME_FROMFIRSTLOGIN = "FIRSTLOGIN";
    public static String WELCOME_FROM = "FROM";
    public static String TYPE = "type";
    public static String LIST = "list";
    public static String ID = "id";
    public static String EDITNMAE_TEXT = "EDITNMAE_TEXT";

    public static String IS_DEVICEUPDATA = "is_deviceUpdata";
    public static String DEVICENAME = "devicename";
    public static String DEVICEBATTERY = "devicebattery";
    public static String DEVICEVERSION = "deviceversion";

    public interface Params {
        String USERNAME = "username";
        String MAC = "mac";
    }

    /**
     * 所有的运动名称
     */
    public static String[] ACTION_NAME = {"跑步", "计步", "深蹲", "深蹲跳", "仰卧起坐", "卷腹", "俯卧撑", "平板支撑"};

    /**
     * 所有的运动代号
     * <p>
     * 11. 跑步
     * 21. 步行
     * <p>
     * 31. 深蹲
     * 32. 深蹲跳
     * 33. 仰卧起坐
     * 34. 卷腹
     * 35. 俯卧撑
     * 36. 臀桥
     * 37. 直桥
     * 38. 两头起
     * 39. 小飞燕
     * 51. 坐姿收腿
     * 52. 卷腹左右摸脚
     * <p>
     * 41. 平板支撑
     */
    public static int[] ACTION_NAME_ID = {
            ActionType.RUNNING, ActionType.WALK, ActionType.SD, ActionType.SDT, ActionType.YWQZ,
            ActionType.JF, ActionType.TQ, ActionType.ZQ, ActionType.LTQ,
            ActionType.XFY, ActionType.ZZST, ActionType.JFZYMJ, ActionType.PBZC};

    public static int[] ACTION_NAME_ID1 = {ActionType.SDT, ActionType.YWQZ, ActionType.JF,
            ActionType.PBZC, ActionType.TQ, ActionType.ZQ, ActionType.LTQ, ActionType.XFY,
            ActionType.ZZST, ActionType.JFZYMJ, ActionType.RUNNING};

    public static int[] ACTION_NAME_ID2 = {ActionType.SDT, ActionType.YWQZ, ActionType.JF, ActionType.WALK,
            // ActionType.FWC,
            ActionType.PBZC, ActionType.TQ, ActionType.ZQ, ActionType.LTQ, ActionType.XFY,
            ActionType.ZZST, ActionType.JFZYMJ};

    /**
     * 当前应用包名
     */
    public static final String MYAPP_PKG = UIUtils.getContext().getPackageName();
    /**
     * 应用宝包名
     */
    public static final String QQDOWNLOADER_PKG = "com.tencent.android.qqdownloader";
    /**
     * 酷跑游戏包名
     */
    public static final String GAME_PKG = "com.Company.MFParkour";

    /**
     * 固件升级文件
     */
    public static String UPDATE_FILE = SDCARDPATH + "update/";

    /**
     * 蓝牙通讯常量
     */
    public static byte BLE_Command_head = (byte) 0xAA;

    /**
     * 正确的语音
     */
    public static final int[] ACTION_CORRECT_VOICE = {
            R.raw.voice_correct_1,
            R.raw.voice_correct_2,
            R.raw.voice_correct_3};

    /**
     * 平板支撑错误类型
     */
    public static String[] PBZC_ERROR_TYPE = {"", "平板撑时角度未达标", "支撑时抖动", "", "", ""};
    public static String[] PBZC_ERROR_INFO = {
            // "上身未保持水平",
            "身体臀部过高",
            "身体抖动过大",
            "身体右肩过高",
            "身体左肩过高",
            "身体臀部过低"};

    public static final int[] PBZC_ERROR_VOICE = {
            R.raw.voice_error_17,
            R.raw.voice_error_13,
            R.raw.voice_error_11,
            R.raw.voice_error_12,
            R.raw.voice_error_16
    };

    /**
     * 仰卧起坐 错误类型
     */
    public static String[] YWQZ_ERROR_TYPE = {"", "上升过快", "上升角度未到位", "下降过快", "上升角度过大"};
    public static String[] YWQZ_ERROR_INFO = {
            "上升过快",
            "起身角度过小",
            "下降过快",
            "起身角度过大"};

    public static final int[] YWQZ_ERROR_VOICE = {
            R.raw.voice_error_7,
            R.raw.voice_error_4,
            R.raw.voice_error_8,
            R.raw.voice_error_3};

    /**
     * 俯卧撑 错误类型
     */
    public static String[] FWC_ERROR_TYPE = {"", "姿态不正确", "下降角度未达标", "上升角度未达标",
            "左肩高于右肩", "右肩高于左肩"
    };

    public static String[] FWC_ERROR_INFO = {
            "臀部过高",
            "身体下降过小",
            "身体上升过小",
            "左肩高于右肩",
            "右肩高于左肩",
    };

    public static final int[] FWC_ERROR_VOICE = {
            R.raw.voice_error_17,
            R.raw.voice_error_10,
            R.raw.voice_error_9,
            R.raw.voice_error_20,
            R.raw.voice_error_19};


    /**
     * 卷腹 错误类型
     */
    public static String[] JF_ERROR_TYPE = {"", "姿态不正确", "上升角度过大", "上升角度过小", "最高点未停顿（0.5s）", "下降过快"};
    public static String[] JF_ERROR_INFO = {
            "上升过快",
            "起身角度过大",
            "起身角度过小",
            "起身后未停顿",
            "下降过快"};

    public static final int[] JF_ERROR_VOICE = {
            R.raw.voice_error_7,
            R.raw.voice_error_3,
            R.raw.voice_error_4,
            R.raw.voice_error_2,
            R.raw.voice_error_8};

    /**
     * 深蹲跳 错误类型
     */
    public static String[] SDT_ERROR_TYPE = {"", "下蹲时背部弯曲", "背部垂直地面下蹲", "起跳高度过低"};
    public static String[] SDT_ERROR_INFO = {
            "姿态不正确",
            "身体下降过小",
            "身体上升过小"};

    public static final int[] SDT_ERROR_VOICE = {
            R.raw.voice_error_15,
            R.raw.voice_error_10,
            R.raw.voice_error_9};


    /**
     * 深蹲 错误类型
     */
    public static String[] SD_ERROR_TYPE = {"", "下降过快", "下蹲时背部弯曲", "起身时上升过快", "背部垂直地面下蹲"};
    public static String[] SD_ERROR_INFO = {"",
            "下降过快",
            "背部弯曲",
            "上升过快",
            "身体重心靠后"};

    public static final int[] SD_ERROR_VOICE = {0,
            R.raw.voice_error_8,
            R.raw.voice_error_1,
            R.raw.voice_error_7,
            R.raw.voice_error_18};


    /**
     * 动作库
     */
    public static class DetailedDescription {
        public static final String heart1 = "动作要领";
        public static final String heart2 = "呼吸";
    }

    /**
     * 动作库错误
     */
    public static final String[] DETAILED_DESCRIPTION_CONTENT = {"头部, 肩部, 上背部, 下背部保持同一平面, 保持均匀呼吸", "请保持身体稳定, 避免剧烈抖动"};
    public static final String[] DETAILED_DESCRIPTION_HUXI = {"请保持身体稳定, 避免剧烈抖动"};

    /**
     * 动作库详情页面错误文字
     */
    public static final String[] SD_DETAILED_DESCRIPTION_CONTENT = {
            "伸出双臂保持平衡,重心在脚跟",
            "蹲下和升起时背部保持挺直状态",
            "脚跟与肩同宽，下蹲膝关节不过脚尖"};
    public static final String[] SD_DETAILED_DESCRIPTION_HUXI = {
            "下蹲时吸气，蹲起时呼气尖"};
    public static final String[] SD_DETAILED_DESCRIPTION_ERROR = {
            "下降过快",
            "背部弯曲",
            "上升过快",
            "身体重心靠前"};

    public static final String[] SDT_DETAILED_DESCRIPTION_CONTENT = {
            "双手抱拳贴于胸口，手肘向下,双手抱拳贴于胸口",
            "脚跟与肩同宽，蹲下和升起时背部保持挺直状态",
            "落地时略向前俯身，并屈膝缓冲"};
    public static final String[] SDT_DETAILED_DESCRIPTION_HUXI = {
            "起跳瞬间憋气"};
    public static final String[] SDT_DETAILED_DESCRIPTION_ERROR = {
            "背部弯曲",
            "身体重心靠前",
            "跳起高度过低"};

    public static final String[] JF_DETAILED_DESCRIPTION_CONTENT = {
            "平躺于地面上，脚面放平，双膝弯曲90°，双手伸直搭在双腿上",
            "微微用力向上抬起，腰部固定，手肘保持向外打开固定",
            "最高点停顿1s"};
    public static final String[] JF_DETAILED_DESCRIPTION_HUXI = {
            "卷腹时呼气，下落时吸气"};
    public static final String[] JF_DETAILED_DESCRIPTION_ERROR = {
            "上升过快",
            "起身角度过大",
            "起身角度过小",
            "起身顶点未停顿",
            "下降过快"};

    public static final String[] YWQZ_DETAILED_DESCRIPTION_CONTENT = {
            "起身动作双手脑后触底，脚底并拢",
            "身体头部、肩部、上背部、下背部依次立地，背部保持挺立"};
    public static final String[] YWQZ_DETAILED_DESCRIPTION_HUXI = {
            "起身时呼气，还原时吸气"};
    public static final String[] YWQZ_DETAILED_DESCRIPTION_ERROR = {
            "上升过快",
            "起身角度过大",
            "下降过快"};

    public static final String[] FWC_DETAILED_DESCRIPTION_CONTENT = {
            "全程收紧腰腹核心，双手相距略宽于肩膀，身体保持一条直线",
            "弯曲手臂尽量保持在90°左右",
            "上身用力撑起，回到起始位置"};
    public static final String[] FWC_DETAILED_DESCRIPTION_HUXI = {
            "身体下落时吸气，起身时呼气"};
    public static final String[] FWC_DETAILED_DESCRIPTION_ERROR = {
            "臀部过高",
            "身体下降过小",
            "身体上升过小"};

    public static final String[] PBZC_DETAILED_DESCRIPTION_CONTENT = {
            "头部、肩部、上背部、下背部保持同一平面，保持均匀呼吸",
            "请保持身体稳定，避免剧烈抖动"};
    public static final String[] PBZC_DETAILED_DESCRIPTION_HUXI = {
            "全程保持均匀呼吸"};
    public static final String[] PBZC_DETAILED_DESCRIPTION_ERROR = {
            "臀部过高",
            "臀部过低",
            "身体抖动过大",
            "左肩过高",
            "右肩过高"};

    /**
     * 臀桥
     */
    public static final String[] TQ_DETAILED_DESCRIPTION_CONTENT = {
            "仰卧，双腿屈曲略宽于肩，脚跟踩地",
            "腰腹发力将臀部推起，大腿与身体呈一条直线",
            "抬起时上背部支撑地面，保持1s",
            "下落时下背部贴地，但臀部悬空"};
    public static final String[] TQ_DETAILED_DESCRIPTION_HUXI = {
            "臀部抬起时呼气，臀部下落吸气"};
    public static final String[] TQ_DETAILED_DESCRIPTION_ERROR = {
            "上升过快",
            "下降过快",
            "起身角度过小",
            "起身顶点停顿过短"};

    /**
     * 直桥
     */
    public static final String[] ZQ_DETAILED_DESCRIPTION_CONTENT = {
            "双手撑于身后坐在垫子上，双腿伸直与肩部同宽",
            "手掌和脚后跟发力将臀部推起，手臂和双腿收紧",
            "匀速推起身体呈一条直线，保持1s",
            "缓慢下降，还原初始位置"};
    public static final String[] ZQ_DETAILED_DESCRIPTION_HUXI = {
            "全程保持均匀呼吸"};
    public static final String[] ZQ_DETAILED_DESCRIPTION_ERROR = {
            "上升过快",
            "下降过快",
            "起身角度过小",
            "起身顶点停顿过短"};

    /**
     * 两头起
     */
    public static final String[] LTQ_DETAILED_DESCRIPTION_CONTENT = {
            "仰卧，身体成水平的“一”字型",
            "臀部与双肩同时离地，身体的支撑点位于腰部",
            "在最高点稍停片刻，向下腰部贴紧于地面"};
    public static final String[] LTQ_DETAILED_DESCRIPTION_HUXI = {
            "呼气时坐起，吸气时还原"};
    public static final String[] LTQ_DETAILED_DESCRIPTION_ERROR = {
            "上升过快",
            "下降过快",
            "起身角度过小",
            "起身顶点停顿过短",
            "起身角度过大"};

    /**
     * 小飞燕
     */
    public static final String[] XFY_DETAILED_DESCRIPTION_CONTENT = {
            "俯卧，双臂用力向脚的方向伸",
            "双肩向后夹紧、膝盖离地",
            "头、颈保持自然姿态，不要仰头"};
    public static final String[] XFY_DETAILED_DESCRIPTION_HUXI = {
            "抬起时吸气，放下时呼气"};
    public static final String[] XFY_DETAILED_DESCRIPTION_ERROR = {
            "起身角度过小",
            "起身顶点停顿过短"};

    /**
     * 坐姿收腿
     */
    public static final String[] ZZST_DETAILED_DESCRIPTION_CONTENT = {
            "臀部着地，手臂后伸撑地，双腿微屈，腹肌绷紧稳定身体",
            "收腿同时收腹，身体微屈",
            "还原初始位置，均匀循环"};
    public static final String[] ZZST_DETAILED_DESCRIPTION_HUXI = {
            "伸腿时吸气，收腿时呼气"};
    public static final String[] ZZST_DETAILED_DESCRIPTION_ERROR = {
            "上升过快",
            "下降过快",
            "起身角度过小"};

    /**
     * 俄罗斯旋转
     */
    public static final String[] ELS_DETAILED_DESCRIPTION_CONTENT = {
            "腰腹收力，收缩扭动带动双臂的移动",
            "上、下背挺直，上背略微弓起",
            "手接触身体两侧地面，目光跟随双手移动"};
    public static final String[] ELS_DETAILED_DESCRIPTION_HUXI = {
            "转身时呼气，身体转正时吸气"};
    public static final String[] ELS_DETAILED_DESCRIPTION_ERROR = {
            "起身角度过大",
            "向左过小",
            "向右过小"};

    /**
     * 卷腹肘碰膝
     */
    public static final String[] JFZPX_DETAILED_DESCRIPTION_CONTENT = {
            "双手扶于耳旁，腰腹发力将肩部和上背部卷离地面，转动上身手肘交替触碰对侧膝盖",
            "下背部紧贴地面，手肘向外打开固定",
            "用力提膝，腿下放的同时伸直，脚跟不要触碰地面"};
    public static final String[] JFZPX_DETAILED_DESCRIPTION_HUXI = {
            "转身时呼气，中间位置时吸气"};
    public static final String[] JFZPX_DETAILED_DESCRIPTION_ERROR = {
            "向左过小",
            "向右过小",
            "起身顶点停顿过短"};

    /**
     * 卷腹左右摸脚
     */
    public static final String[] JFZYMJ_DETAILED_DESCRIPTION_CONTENT = {
            "腹部发力微抬离地面，双腿屈曲与肩同宽",
            "向身体两侧侧屈，双手交替摸脚，始终保持腹肌紧张"};
    public static final String[] JFZYMJ_DETAILED_DESCRIPTION_HUXI = {
            "摸脚时呼气，还原时吸气"};
    public static final String[] JFZYMJ_DETAILED_DESCRIPTION_ERROR = {
            "向左过小",
            "向右过小",
            "向左过快",
            "向右过快",
            "身体未转动"};

    /**
     * 侧翼平板撑
     */
    public static final String[] CYPBC_DETAILED_DESCRIPTION_CONTENT = {
            "侧躺于垫子上，用手臂支撑起身体",
            "抬起髋部，把整个身体支撑起来",
            "保持身体笔直，收紧臀部"};
    public static final String[] CYPBC_DETAILED_DESCRIPTION_HUXI = {
            "全程保持均匀呼吸"};
    public static final String[] CYPBC_DETAILED_DESCRIPTION_ERROR = {
            "臀部过高",
            "臀部过低",
            "身体抖动过大"};

    public static final String[] TQ_ERROR_TYPE = {"上升过快", "下降过快", "起身角度过小", "起身顶点停顿过短"};
    public static final int[] TQ_ERROR_VOICE = {R.raw.voice_error_7, R.raw.voice_error_8, R.raw.voice_error_4, R.raw.voice_error_21};

    public static final String[] LTQ_ERROR_TYPE = {"上升过快", "下降过快", "起身角度过小", "起身顶点停顿过短", "起身角度过大"};
    public static final int[] LTQ_ERROR_VOICE = {R.raw.voice_error_7, R.raw.voice_error_8, R.raw.voice_error_4, R.raw.voice_error_21, R.raw.voice_error_3};

    public static final String[] XFY_ERROR_TYPE = {"起身角度过小", "起身顶点停顿过短"};
    public static final int[] XFY_ERROR_VOICE = {R.raw.voice_error_4, R.raw.voice_error_21};

    public static final String[] ZQ_ERROR_TYPE = {"上升过快", "下降过快", "起身角度过小", "起身顶点停顿过短"};
    public static final int[] ZQ_ERROR_VOICE = {R.raw.voice_error_7, R.raw.voice_error_8, R.raw.voice_error_4, R.raw.voice_error_21};

    public static final String[] ZJST_ERROR_TYPE = {"上升过快", "下降过快", "起身角度过小"};
    public static final int[] ZJST_ERROR_VOICE = {R.raw.voice_error_7, R.raw.voice_error_8, R.raw.voice_error_4};

    public static final String[] JFZYMJ_ERROR_TYPE = {"向左过小", "向右过小", "向左过快", "向右过快", "身体未转动"};
    public static final int[] JFZYMJ_ERROR_voice = {R.raw.voice_error_25, R.raw.voice_error_23, R.raw.voice_error_24, R.raw.voice_error_22, R.raw.voice_error_26};


}
